package cn.codinglives.demo.gateway.config;

import cn.codinglives.demo.gateway.filters.RouteMsgFilter;
import cn.codinglives.demo.gateway.filters.StripPrefixFilter;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
public class GlobalFilterConfiguration {

//    @Order(Integer.MIN_VALUE)
//    @Bean
    public GlobalFilter stripPrefixFilter() {
        return new StripPrefixFilter();
    }

    @Bean
    @Order(Integer.MAX_VALUE)
    public GlobalFilter routeMsgFilter() {
        return new RouteMsgFilter();
    }
}
